package com.kedacom.freedomLabel.initdata.bean;

import android.util.Log;

import java.text.SimpleDateFormat;

/**
 * Created by yao on 2021/3/25.
 * Describe
 */

public class ClonePostUtil {

    static SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    public static PostProduct ClonePost(Post post, PostProduct postBean) {

        try {

            postBean.setRecordId(Long.parseLong(post.getRecordId()));
            postBean.setWeighingTime(formatter.format(post.getWeighingTime()));
            postBean.setGridName(post.getGridName());

            postBean.setGridType(post.getGridType());
            postBean.setWeighingType(post.getWeighingType());
            postBean.setTotalWeight(post.getTotalWeight());

            postBean.setPartsWeight(post.getPartsWeight());
            postBean.setActualWeight(post.getActualWeight());
            postBean.setQualifiedType(post.getQualifiedType());

            postBean.setClasses(post.getClasses());
            postBean.setWorkTeam(post.getWorkTeam());
            postBean.setStaff(post.getStaff());

            postBean.setMachineCode(post.getMachineCode());
            postBean.setInstrument(post.getInstrument());
            postBean.setMemo(post.getMemo());
        } catch (Exception e) {
            Log.d("CLONE ERROR ==:", e.toString());
        }

        return postBean;
    }
}
